﻿@model IEnumerable<QLTL_V2.Models.Product>

@{
    ViewBag.Title = "Danh Sách Sản Phẩm";
}

<h2> @ViewBag.Title</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>       
        <th>
            Tên 
        </th>
        <th>
            Hình Ảnh
        </th>
        <th>
            Đặc Tả 
        </th>
        <th>
            Thời gian
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>        
        <td>
            @Html.DisplayFor(modelItem => item.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ImageUrl)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Description)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.CreatedTime)
        </td>
        <td>
           <div id="link_icon">
            <a href="@Url.Action("Edit", "Product", new { id = @item.ProductId })"> <img src="../../Content/Images/edit-icon.png " height="25px" width="25px"/></a> 
            <a href="@Url.Action("Details", "Product", new { id = @item.ProductId })"><img src="../../Content/Images/detail-icon.png" height="25px" width="25px" /></a> 
            <a href="@Url.Action("Delete", "Product", new { id = @item.ProductId })"><img src="../../Content/Images/delete_icon.png" height="25px" width="25px"/></a> 

        </div>
    </tr>
}

</table>
